Add DNS forwarding groundwork#1813
Conversation
0ebac6f to
65062e8
Compare
If any containers are running, mDNSResponder will already be trying to do this. Are you sure you can do that listen as a non-root user? Either of those would cause the listen to not happen on the vmnet bridge IP addresses. |
5e30134 to
712f517
Compare
|
Fixed by removing listener startup from this PR. I tested the narrower design after your comment: move the listener into the vmnet helper and bind to each network gateway instead of APIServer wildcard The current PR now keeps only the reusable DNS forwarding/message groundwork. The actual listener should be a separate design, likely mDNSResponder integration or a privileged packet-filter redirection path from vmnet gateway DNS to a host-local resolver. |
Let's not give up on this yet. What happens if in your local build, you make a change to the vmnet network configuration in ReservedVmnetNetwork to [disable the DNS proxy]((https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_disable_dns_proxy(_:))? Given the breadth of the DNS work you're doing, I think we really need a design doc docs/design/dns.md that describes how We don't need to do all the design up front but perhaps it does include a stubbed outline based on what exists and the various enhancements you're proposing. This should help us manage fixes and enhancements such that the subsystem functions reliably and the user gets the best possible experience. Facets of the
|
|
I tested this with a signed temp-root vmnet helper using the repo entitlements and a full temp plugin layout. Result:
So disabling the DNS proxy alone does not make the gateway address host-bindable in this environment. I left listener startup out of the runtime path and added |
Summary
This PR keeps the reusable DNS plumbing needed for future container-facing service discovery, but it no longer starts a container-facing listener.
notImplementeddocs/design/dns.mdto document current DNS paths, behavioral invariants, extension points, and the latest vmnet validation resultDesign note
This previously tried to bind a container-facing resolver on UDP/53. Review called out that wildcard binding races with mDNSResponder and may not cover vmnet bridge IPs.
I tested a narrower temp-install design that moved the listener into the vmnet helper and bound it to each reported network gateway address. Gateway binds failed with
EADDRNOTAVAIL.I also tested the maintainer-suggested local change to call
vmnet_network_configuration_disable_dns_proxy(vmnetConfiguration)beforevmnet_network_create. With a signed temp-root helper and the repo vmnet entitlements, the vmnet network still started successfully, but binding192.168.64.1:53still failed withEADDRNOTAVAIL.So this PR intentionally keeps listener startup out of the runtime path. The remaining container-facing listener design question is whether vmnet exposes a different host-bindable endpoint, or whether this needs an mDNSResponder or packet-filter integration path.
Related
This PR is stacked and currently includes the commit from #1810. I can rebase once #1810 lands or retarget however maintainers prefer.
Testing
git diff --check origin/main..HEADswift test -c debug -Xswiftc -warnings-as-errors --filter 'ForwardingResolverTest|CompositeResolverTest|RecordsTests|AttachmentAllocatorTest'swift build -c debug -Xswiftc -warnings-as-errors --product container-apiserverswift build -c debug -Xswiftc -warnings-as-errors --product container-network-vmnet192.168.64.1:53failed withEADDRNOTAVAIL.vmnet_network_configuration_disable_dns_proxyapplied: network started, gateway bind to192.168.64.1:53still failed withEADDRNOTAVAIL.